<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="x-ua-compatible" content="ie=edge">
	<title>信息录入</title>
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<link rel="stylesheet" href="drive_information.css">
	<link rel="stylesheet" href="normalize.css">
</head>
<body>
<header class="clearfix">
	<ul>
		<li><button onclick="history.back(0)" class="information_btn1"></button></li>
		<li><p style="padding-left: 8rem;border-left: 0px solid #efdedd;">送考信息</p></li>
	</ul>
</header>
<section class="mainbody">
	<form class="information_collect">
		<span>科目:</span>
		<!-- <input class="message_input" type="text"> -->
		<select class="message_input subject" id="subject" >
			<option class="">请选择</option>
			<option value="kemu2">科目二</option>
			<option value="kemu3">科目三</option>
		</select>
		<br/>
		<span>接送时间:</span>
		<input class="message_input time" type="text"   onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
		<br/>
		<span>接送地址:</span>
		<input class="message_input " id="address" type="text" />
		<input class="submit_final submit" type="button" value="提交" >
	</form>
</section>

<script src="jquery.min.js"></script>
<script src="../layer.js"></script>
<script src="picturefill.js"></script>
<script src="laydate/laydate.js"></script>

<script>

	$(function () {

		$('.submit').on('click', function () {
			var token = localStorage.phone;
			var teacher_id=localStorage.teacher;
			var time = $('.time').val();
			var obj = window.document.getElementById("subject");
			var address=$('#address').val();
			var subject=obj.options[obj.selectedIndex].text;
		$.ajax({
			url:"https://newapp.icandrive.cn/api/songkao.php",
			type:'post',
			data:{token:token,subject:subject,time:time,address:address,teacher_id:teacher_id},
			dataType:'json',
			success:function(data){
				if(data.status==200){
					layer.msg('约考成功');
					setInterval(function () {
						window.location.href='../index/index.html'
					},2000)
				}
				else{
					 layer.msg('系统维护中',function(){
                                history.go(0)
                            },1000);
				}

						},
			error:function(){



			}
	})
		});
		})
</script>

    <script>
    document.addEventListener("plusready", function() {
        // 注册返回按键事件
        plus.key.addEventListener('backbutton', function() {
            window.history.back();
        }, false);
        //此处false代表不退出页面，如果为true回退到上一个一面
    });
</script>
</body>
</html>
